package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import cn.wolfcode.util.BusinessReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class BusinessReportQueryObject extends QueryObject {
    private String groupType = BusinessReportEnum.CONSUME.getValue();
    private Long businessId;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private Integer status;
    private Boolean ano;

    //使用工具类 修改时间为23:59:59
    public Date getEndDate(){
        if(endDate == null){
            return null;
        }
        return  DateUtil.endOfDay(endDate);
    }
}
